-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[24.1] Allow drag and drop for collection elements #18699
[24.1] Allow drag and drop for collection elements #18699
Conversation
793fe46
to
f99d3d1
Compare
40379b8
to
32c57a8
Compare
Added a new composable in commit f65df80 ; that prevents duplicate code in |
type = "dataset"; | ||
id = item.object.id; | ||
} else { | ||
throw new Error(`Invalid item type${item.element_type ? `: ${item.element_type}` : ""}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was an error handler in https://github.com/galaxyproject/galaxy/pull/18699/files#diff-68e87a439364cbb0acfc54a106c0830012c8005d4288102ba12a57fc7ffcedd6L408, you might want to re-instate that. This btw can happen if the collection isn't populated yet, so we'll definitely run into this from time to time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you added a handler in https://github.com/galaxyproject/galaxy/pull/18699/files#diff-ad4aa7272cdb314a83cba0349216030549831df46d0113ef0d5b60a67d72a26aR160 ... I think it might be better to do error handling like this in the caller, so context-specific actions can be taken (e.g. Toast vs inline errors in this example). Also the caller might want to know if the action succeeded, which it will always if you catch the error.
} else { | ||
throw new Error(`Invalid item type${item.element_type ? `: ${item.element_type}` : ""}`); | ||
} | ||
await copyDataset(id, historyId, type, dataSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you'd want to loop over the items to drag first and make sure none of them run into https://github.com/galaxyproject/galaxy/pull/18699/files#r1734725855 ? Otherwise it might be a little messy if a fraction of items is copied and another is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the actual copy operation to another loop, so that if errors are caught for any item, we never copy anything from then on.
From what I understand, if there is any error with:
historyStore.createNewHistory();
!historyId
- Invalid item type
copyDataset
loadHistoryById
the error would be handled and Toast-ed in useHistoryDragDrop.onDrop()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice deduplication, thank you!
We extract the `HDAObject` from the `DCESummary` to be able to drag and drop it. For now, this works on dragging and dropping items to histories, since that process only needs the dataset's id. However, this doesn't work on tool forms; as we would need to get the full `HDASummary` to do that.
for now, only `getDragData` for `DCEDataset`s
Co-authored-by: David López <[email protected]>
This unifies the drag and drop operations in `HistoryPanel` as well as the drop area in the `MultipleViewList`.
3096b7f
to
c742333
Compare
We extract the
HDAObject
from theDCESummary
to be able to drag and drop it. For now, this works on dragging and dropping items to histories, since that process only needs the dataset's id. However, this doesn't work forDCECollections
because they aredataset_collection
s and notHDCA
s.Drag and drop DCEs into Tool forms:
Fixes #18692
drag_drop_DCE_toolform.mp4
Drag and drop DCEs to other histories:
Note that this won't work for
DatasetCollectionElement
s that are of typedataset_collection
.DCEDataset
s can be moved:drag_drop_DCE_historypanel.mp4
How to test the changes?
(Select all options that apply)
License